#!../mlisp

;;; Tower of hanoi

(load "arc.arc")

(def hanoi (n from to temp)
  (when (> n 0)
    (hanoi (- n 1) from temp to)
    (prn "move " n ": " from " -> " to)
    (hanoi (- n 1) temp to from)))

(let n (if (no *args*)
           4
         (coerce (car *args*) 'int))
  (hanoi n 'A 'B 'C))
